package de.sendorian.app.forumArchive.dundjinni;


import java.util.ArrayList;
import java.util.List;

import org.apache.commons.lang.StringUtils;

import de.sendorian.app.forumArchive.domain.Topic;
import de.sendorian.util.matcher.BlacklistMatcher;

/**
 * Matches Topics that should be ignored that are not an Announcement or sticky topic.
 *
 * @author sendorian
 *
 */
public class DundjinniIgnorableTopicsMatcher extends BlacklistMatcher<Topic> {

	private static final List<String> unwantedTopicNames = new ArrayList<String>();

	static {
		unwantedTopicNames.add("Moved:");
		unwantedTopicNames.add("Poll:");
		unwantedTopicNames.add("Monthly Archive");
	}

	public DundjinniIgnorableTopicsMatcher() {
		super(unwantedTopicNames);
	}


	@Override
	protected boolean matchesInternal(Topic topic, Object unwantedTopic) {
		return StringUtils.containsIgnoreCase(topic.getName(), (String) unwantedTopic);
	}

}
